home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 February
/
Macworld (1999-02).dmg
/
Cinema 4D GO demo
/
Gumption Plug-ins
/
Plug-ins
/
Freeware
/
RevealTangents
/
RevealTangents.cof
Wrap
Text File
|
1997-12-30
|
936b
|
49 lines
// EqualTangents
// set all selected zero tangents to non-zero values
// (c) Christian Losch
// 1998 Maxon Computer GmbH
var len_vl,len_vr;
Function(doc)
{
var i,num,op,info,sp;
// allocate all data
info = new (SplineInfo); if (!info) return;
sp = new (SplinePoint); if (!sp) return;
// get active object
op = doc->FindFirstActiveObject(); if (!op || getclass(op)!=SplineObject) return;
op->GetSplineInfo(info);
if (info->type!=SPL_HERMITE)
{
TextDialog("No Hermite Spline");
return;
}
// change tangents
num = op->GetPointNumber();
for (i=0; i<num; i++)
{
if (op->IsPointSelected(i) && op->GetPoint(i,sp))
{
if (vlen(sp->vl)==0.0 && vlen(sp->vr)==0)
{
sp->vl = vector(-10,0,0);
sp->vr = vector( 10,0,0);
op->SetPoint(i,sp);
}
}
}
op->UpdateObject();
doc->SendMessage(ACTIVE_OBJECT_CHANGED);
}
main()
{
len_vl = len_vr = 50.0;
RegisterMenuHook("Reveal Tangents","Function");
}